﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace NF_Tools
{
    public partial class BF_PriceSet : UserControl
    {
        public BF_PriceSet()
        {
            InitializeComponent();
        }

        //包间类型ID、日期id、时间段id
        [Category("自定义属性"), Description("包间类型ID")]
        public int TypeId { get; set; }

      
        [Category("自定义属性"), Description("时间段ID")]
        public int TimeId { get; set; }

        [Browsable(true), Category("自定义属性"), Description("价钱")]
        public int PriceOnLine
        {
            get { return Convert.ToInt32(bF_TextBox1.Text); }
            set { bF_TextBox1.Text = value.ToString(); }
        }

        [Browsable(true), Category("自定义属性"), Description("价钱")]
        public int PriceOutLine
        {
            get { return Convert.ToInt32(bF_TextBox2.Text); }
            set { bF_TextBox2.Text = value.ToString(); }
        }


        [Browsable(true), Category("自定义属性"), Description("时间段")]
        public string TimeSpan
        {
            get { return label3.Text; }
            set { label3.Text = value; }
        }

        [Browsable(true), Category("自定义属性"), Description("当前日期选中的集合")]
        public string WeekStr
        {
            get {
                if (label1.Text.Length > 1)
                    return label1.Text.Substring(0, label1.Text.Length - 2);
                else
                    return label1.Text;
            }
            set { label1.Text = value + ">"; }
        }
      

       


        private void bF_TextBox1_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (char.IsNumber(e.KeyChar) || e.KeyChar== '\b')
                e.Handled = false;
            else
                e.Handled = true;
        }


        //定义委托
        public delegate void ExPandHandle(object sender, EventArgs e);
        //定义事件
        public event ExPandHandle ExPand;
        private void label1_Click(object sender, EventArgs e)
        {
            if (ExPand != null)
                ExPand(sender, new EventArgs());//把按钮自身作为参数传递
        }
    }
}
